<?php
	if ($act == 'reset') {
		$reitingclass->reset_reiting();
	} elseif ($act == 'reset_by_parent') {
		if (isset($_POST["parent"]) && (strlen($_POST["parent"])> 0)){	
			$reitingclass->reset_reiting_by_parent($_POST["parent"]);
		}
	} elseif ($act == 'reset_by_parent_and_name') {
		if (isset($_POST["parent"]) && (strlen($_POST["parent"])> 0) && isset($_POST["name"]) && (strlen($_POST["name"])> 0)){
			$reitingclass->reset_reiting_by_parent_and_name($_POST["parent"], $_POST["name"]);
		}
	} elseif ($act == 'add_reiting') {
		if (isset($_POST["name"]) && (strlen($_POST["name"])> 0)){
			$reitingclass->add_new_reiting($_POST["name"]);
		}
	} elseif ($act == 'mod') {
		if (isset($_POST['form_id'])) $form_id=$_POST['form_id']; else $form_id = "";
		if (($form_id != "") and ($form_id > 0)){
			$treeclass->del_form_elem_data($form_id, 'module_raiting');
			foreach($_POST['form_array'] as $name=>$value) {
				$value = addslashes(trim($value));
				if (($value != '') && ($value != '0')) $treeclass->mod_form_elem_data($id, $form_id, $name, $value, 'module_raiting');
			}
		}
	} elseif ($act == 'checking') {
		if (isset($_POST['check'])) $reitingclass->set_checking(1);
		else $reitingclass->set_checking(0);
	} elseif ($act == 'del_one') {
		if ($parent > 0) $reitingclass->del_new_reiting($parent);
	}
?>